#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
6、有一堆字符串“aabbbcddef”打印出不重复的字符串结果：cef #不允许用类型转化
7、有一堆字符串，“welocme to super&Test”，打印出superTest，#不能查字符的索引
8、有一堆字符串，“welocme to super&Test”，打印出tseT&repus ot  #不允许用reverse,和reversed
9、有一堆字符串，“abcdef”，将首尾反转，结果：fedcba，不能使用现有的函数或方法，自己写算法实现,不允许用步长
10、有一堆字符串，“aabbbcddef”，输出abcdef # 不允许用set
'''

class Zifuchuan(object):
    def __init__(self, num_str):
        self.str_01 = num_str

    def a_quchong(self):
        b = ''
        for i in self.str_01:
            if i not in b:
                b += i
        print(b)

    def superTest(self):
        b = self.str_01.split(' ')
        for i in b:
            if i.isalpha() == False:
                c = i.split('&')
                for j in c:
                    print(j, end='')
                    print('')

    def quchong_10(self):
        b = ''
        for i in self.str_01:
            if i not in b:
                b += i
        print(b)

    def tseTrepus(self):
        a = self.str_01.split(' ')
        # 拼接
        a = a[1] + ' ' + a[2]
        # 倒序排列
        a = a[::-1]
        print(a)

    def nizhi(self):
        b = []
        for i in range(len(self.str_01)):
            b.append(self.str_01[len(self.str_01) - 1 - i])
        for c in b:
            print(c, end='')


if __name__ == '__main__':
    str_02 = 'aabbbcddef'
    result = Zifuchuan(str_02)
    result.a_quchong()
    str_03 = 'welocme to super&Test'
    result = Zifuchuan(str_03)
    result.superTest()
    str_04 = 'welocme to super&Test'
    result = Zifuchuan(str_04)
    result.tseTrepus()
    str_05 = 'abcdef'
    result = Zifuchuan(str_05)
    result.nizhi()
    str_06 = 'aabbbcddef'
    result = Zifuchuan(str_06)
    result.quchong_10()